Ext.onReady(function(){
	/*
	 * Ping the server every 30 minutes to keep user logged in
	 * If, for some reason, session does expire, redirect to login page
	 * and log out user.
	 */
	var pingUpdate = new Ext.Updater('pingDiv');
	pingUpdate.startAutoRefresh(1800, "ping.php");
	pingUpdate.on("update", pingReply);
	
	function pingReply (el, response) {
   		if (response.responseText != 'logged in') {
   			window.location = 'login.php?logout=1';
   		}
	}
});	